<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
	 var aa = [
                {"id":28,"text":"公司信息",    
                    "children":[
                        {"id":1,"text":"公司文化"},{"id":2,"text":"招聘计划"},
                        {"id":6,"text":"公司新闻","children":[{"id":47,"text":"行业新闻"}]},
                        {"id":11,"text":"内部新闻","children":[{"id":24,"text":"行政信息"},{"id":27,"text":"高层指示"}]},
                        {"id":22,"text":"联系我们"},
                        {"id":26,"text":"产品展示","children":[{"id":32,"text":"电力产品"},{"id":33,"text":"配件介绍","children":[{"id":55,"text":"公司文化"}]}
                        ]}
                    ]
                 }
             ] 
             
            for(var i = 0;i<aa.length;i++){
              print(aa[i]);
            }
        function print(arr){
            for(var item in arr){
                if(typeof(arr[item])=='object'){
					console.log("我有后代"+"我是"+arr[item]);
                    for(var i = 0;i<arr[item].length;i++){
                        print(arr[item][i]);
                    }
                }
                else{
                    console.log('没有后代'+"我是"+arr[item]);
                    
                }
            }
        }
		</script>
	</head>
	<body>
	</body>
</html>
